Visual Basic (Declaration) | |
---|---|
Public ReadOnly Property Count As Integer |
Visual Basic (Usage) | ![]() |
---|---|
Dim instance As WeakRefDictionary(Of TKey,TValue) Dim value As Integer value = instance.Count |
C# | |
---|---|
public int Count {get;} |
Since the items in the dictionary are held by weak reference, the count value cannot be relied upon to guarantee the number of objects that would be discovered via enumeration. Treat the Count as an estimate only. This property also has the side effect of clearing out any GC'd refs.
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family